#创建一个进程
# from multiprocessing import Process
# def ran():
#     print("123")
#
# def run1():
#     print("234")
# if __name__=="__main__":
#     p = Process(target=ran)
#     p.start()
#     p.join()
#     p1 = Process(target=run1)
#     p1.start()
#     p1.join()


# import multiprocessing
#
# import time
# def test():
#     n = 5
#     while n>0:
#         print(n)
#         time.sleep(1)
#         n-=1
# if __name__=="__main__":
#     p = multiprocessing.Process(target=test)
#     p.start()
#     p.join()


import multiprocessing
import time
# class MyProcess(multiprocessing.Process):
#     def run(self):
#         n = 5
#         while n>0:
#             print(n)
#             time.sleep(1)
#             n -= 1
# if __name__=="__main__":
#     p = MyProcess()
#     p.start()
#     p.join()

# from multiprocessing import Pool
# import time
# def work(num):
#     print(num)
#     time.sleep(2)
# if __name__=="__main__":
#     po = Pool()
#     for i in range(100):
#         po.apply_async(work,(i,))
#     po.close()
#     po.join()







